Remove useless SIF_XXX_BE_DOMAIN driver flags.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 17 Oct 2005 14:54:28 +0000 (15:54 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 17 Oct 2005 14:54:28 +0000 (15:54 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
linux-2.6-xen-sparse/drivers/xen/netback/netback.c
linux-2.6-xen-sparse/drivers/xen/tpmback/tpmback.c
linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypervisor.h
linux-2.6-xen-sparse/include/asm-xen/asm-ia64/hypervisor.h
tools/python/xen/xend/XendDomainInfo.py
xen/arch/ia64/xen/domain.c
xen/include/public/xen.h

index c7693422551e8d7628d2755badcadf74597d3e73..c9d812695ef45530a24043ab175b5405a3cd279b 100644 (file)
@@ -494,10 +494,6 @@ static int __init blkif_init(void)
        int i;
        struct page *page;
 
-       if (!(xen_start_info->flags & SIF_INITDOMAIN) &&
-           !(xen_start_info->flags & SIF_BLK_BE_DOMAIN))
-               return 0;
-
        blkif_interface_init();
 
        page = balloon_alloc_empty_page_range(MMAP_PAGES);
index edb5360cd70d7adb3739a8c7bfe27a622901cec8..671f16038cc57747753c48c65ea583e34b935f69 100644 (file)
@@ -725,21 +725,9 @@ static struct xenbus_driver blkfront = {
        .suspend = blkfront_suspend,
 };
 
-static void __init init_blk_xenbus(void)
-{
-       xenbus_register_driver(&blkfront);
-}
-
 static int __init xlblk_init(void)
 {
-       if ((xen_start_info->flags & SIF_INITDOMAIN) ||
-           (xen_start_info->flags & SIF_BLK_BE_DOMAIN) )
-               return 0;
-
-       IPRINTK("Initialising virtual block device driver\n");
-
-       init_blk_xenbus();
-
+       xenbus_register_driver(&blkfront);
        return 0;
 }
 
index 748dcdd2c0af7d0e834d75bdaf91cfe832b4c1ad..dacedfc2274c25a93bc5fcf6cf1c45ea1048b3d8 100644 (file)
@@ -861,11 +861,7 @@ static int __init blkif_init(void)
 {
        int i, j, err;
        struct page *page;
-/*
-  if ( !(xen_start_info->flags & SIF_INITDOMAIN) &&
-  !(xen_start_info->flags & SIF_BLK_BE_DOMAIN) )
-  return 0;
-*/
+
        blkif_interface_init();
 
        page = balloon_alloc_empty_page_range(MMAP_PAGES);
index 1c29a97f9d4a25085edcecb3e7c973551cf7e624..656ed94ded44870e50fa9ea135f54d99c54e5175 100644 (file)
@@ -781,12 +781,6 @@ static int __init netback_init(void)
        int i;
        struct page *page;
 
-       if (!(xen_start_info->flags & SIF_NET_BE_DOMAIN) &&
-           !(xen_start_info->flags & SIF_INITDOMAIN))
-               return 0;
-
-       IPRINTK("Initialising Xen netif backend.\n");
-
        /* We can increase reservation by this much in net_rx_action(). */
        balloon_update_driver_allowance(NETIF_RX_RING_SIZE);
 
index 0a8d70528c12978703b68615410eb6f97161603c..9b02556e564702dd1868cb48651a21424bc668e8 100644 (file)
@@ -1076,11 +1076,6 @@ static int __init
 tpmback_init(void)
 {
        int rc;
-       if (!(xen_start_info->flags & SIF_TPM_BE_DOMAIN) &&
-           !(xen_start_info->flags & SIF_INITDOMAIN)) {
-               printk(KERN_ALERT "Neither TPM-BE Domain nor INIT domain!\n");
-               return 0;
-       }
 
        if ((rc = misc_register(&ibmvtpms_miscdevice)) != 0) {
                printk(KERN_ALERT "Could not register misc device for TPM BE.\n");
index 55c8761913a5eb3c66ebd63517ca0c7c68e8dcae..06015e6ccb4e06b37324f5ad8303ef6fc82ead6d 100644 (file)
@@ -50,6 +50,8 @@
 # endif
 #endif
 
+extern shared_info_t *HYPERVISOR_shared_info;
+
 /* arch/xen/i386/kernel/setup.c */
 extern start_info_t *xen_start_info;
 
index 6890c67d7d3596d277166646ae3a6aa7eebea50d..da4303f9b698a9dc1ee4e79febd3e6acb8af9c63 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/ptrace.h>
 #include <asm/page.h>
 
+extern shared_info_t *HYPERVISOR_shared_info;
 extern start_info_t *xen_start_info;
 
 void force_evtchn_callback(void);
index 3615aed8d904b18f386dd40ca869b47485d554a0..2c92da390e1086e18e94951fd195f60f3bff6007 100644 (file)
@@ -81,19 +81,8 @@ restart_modes = [
 STATE_DOM_OK       = 1
 STATE_DOM_SHUTDOWN = 2
 
-"""Flag for a block device backend domain."""
-SIF_BLK_BE_DOMAIN = (1<<4)
-
-"""Flag for a net device backend domain."""
-SIF_NET_BE_DOMAIN = (1<<5)
-
-"""Flag for a TPM device backend domain."""
-SIF_TPM_BE_DOMAIN = (1<<7)
-
-
 SHUTDOWN_TIMEOUT = 30
 
-
 DOMROOT = '/local/domain/'
 VMROOT  = '/vm/'
 
@@ -512,11 +501,6 @@ class XendDomainInfo:
             if self.info['maxmem_KiB'] > self.info['memory_KiB']:
                 self.info['maxmem_KiB'] = self.info['memory_KiB']
 
-            # Validate the given backend names.
-            for s in self.info['backend']:
-                if s not in backendFlags:
-                    raise VmError('Invalid backend type: %s' % s)
-
             for (n, c) in self.info['device']:
                 if not n or not c or n not in controllerClasses:
                     raise VmError('invalid device (%s, %s)' %
@@ -678,8 +662,7 @@ class XendDomainInfo:
 
 
     def getBackendFlags(self):
-        return reduce(lambda x, y: x | backendFlags[y],
-                      self.info['backend'], 0)
+        return 0
 
 
     def refreshShutdown(self, xeninfo = None):
@@ -1409,25 +1392,16 @@ class XendDomainInfo:
 implements the device control specific to that device-class."""
 controllerClasses = {}
 
-
-"""A map of backend names and the corresponding flag."""
-backendFlags = {}
-
-
-def addControllerClass(device_class, backend_name, backend_flag, cls):
+def addControllerClass(device_class, backend_name, cls):
     """Register a subclass of DevController to handle the named device-class.
-
-    @param backend_flag One of the SIF_XYZ_BE_DOMAIN constants, or None if
-    no flag is to be set.
     """
     cls.deviceClass = device_class
-    backendFlags[backend_name] = backend_flag
     controllerClasses[device_class] = cls
 
 
 from xen.xend.server import blkif, netif, tpmif, pciif, usbif
-addControllerClass('vbd',  'blkif', SIF_BLK_BE_DOMAIN, blkif.BlkifController)
-addControllerClass('vif',  'netif', SIF_NET_BE_DOMAIN, netif.NetifController)
-addControllerClass('vtpm', 'tpmif', SIF_TPM_BE_DOMAIN, tpmif.TPMifController)
-addControllerClass('pci',  'pciif', None,              pciif.PciController)
-addControllerClass('usb',  'usbif', None,              usbif.UsbifController)
+addControllerClass('vbd',  'blkif', blkif.BlkifController)
+addControllerClass('vif',  'netif', netif.NetifController)
+addControllerClass('vtpm', 'tpmif', tpmif.TPMifController)
+addControllerClass('pci',  'pciif', pciif.PciController)
+addControllerClass('usb',  'usbif', usbif.UsbifController)
index 64eda8638bd1782fd2810faa1fe35a9e0f4cae1b..e77d1d1498c652c524e218d9d768dbe5cbfc5609 100644 (file)
@@ -351,7 +351,7 @@ void new_thread(struct vcpu *v,
                }
                VCPU(v, banknum) = 1;
                VCPU(v, metaphysical_mode) = 1;
-               d->shared_info->arch.flags = (d == dom0) ? (SIF_INITDOMAIN|SIF_PRIVILEGED|SIF_BLK_BE_DOMAIN|SIF_NET_BE_DOMAIN|SIF_USB_BE_DOMAIN) : 0;
+               d->shared_info->arch.flags = (d == dom0) ? (SIF_INITDOMAIN|SIF_PRIVILEGED) : 0;
        }
 }
 
index 3c2d0094f24cdeaf0e3ed25686ee10ec42dc0ae7..c88113ab6c19db56297027a3c05632ac4d2a03a4 100644 (file)
@@ -430,12 +430,6 @@ typedef struct start_info {
 /* These flags are passed in the 'flags' field of start_info_t. */
 #define SIF_PRIVILEGED    (1<<0)  /* Is the domain privileged? */
 #define SIF_INITDOMAIN    (1<<1)  /* Is this the initial control domain? */
-#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
-#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
-#define SIF_USB_BE_DOMAIN (1<<6)  /* Is this a usb backend domain? */
-#define SIF_TPM_BE_DOMAIN (1<<7)  /* Is this a TPM backend domain? */
-/* For use in guest OSes. */
-extern shared_info_t *HYPERVISOR_shared_info;
 
 typedef uint64_t cpumap_t;